// pages/components/gongge/gongge.js
Component({
  properties: {
    imgArr:{
      type: Array
    }
  },
  data: {
    imgNum:0,
    choiceNum:0,
    flavor: [
      "原味","加冰","浓烈","香甜","加奶","狂野"
    ]
  },
  methods:{
    //选择咖啡点击事件
    clickFn(e){
      this.setData({
        imgNum:e.currentTarget.dataset.index
      })
      // 子传父通过triggerEvent来实现,传点击的下标
      this.triggerEvent('fatherEvent', e.currentTarget.dataset.item);
    },
    //选择口味点击事件
    choiceFn(e){
      this.setData({
        choiceNum:e.currentTarget.dataset.index
      })
    }
  }
  
})